<html>
<head>
    <title>Mail</title>
</head>
<body>
<form action="" method="post">
    <textarea name="value" rows="5" cols="50"><?php echo @$_POST['value'];?></textarea>
    <br>
    <input type="submit" value="Submit">
</form>

<?php
    if (@$_POST['value']) {

        // subject
        $subject = 'Test mail function by JBDump';
        
        // message
        $message = '
        <html><body>
          <p>Testing is sending a letter with the PHP mail ().</p>
        </body>
        </html>';
        
        // To send HTML mail, the Content-type header must be set
        $headers  = 'MIME-Version: 1.0' . "\r\n";
        $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
        
        // Additional headers
        $headers .= 'To: '.$_POST['value']."\r\n";
        $headers .= 'From: JBDump class <jbdump@joomla-book.ru>' . "\r\n";
        
        // Mail it
        jbdump(mail($to, $subject, $message, $headers), 0, 'mail() result');
    }
?>

</body>
</html>
